package org.bhf.service;

import com.google.inject.Scopes;
import com.google.inject.servlet.ServletModule;
import org.bhf.providers.ccache.ComponentStateCache;
import org.bhf.providers.ccache.LRUComponentStateCache;
import org.bhf.providers.resolvers.I18nViewResolver;
import org.bhf.providers.router.DefaultURLRouter;
import org.bhf.providers.security.PBECSRTokenFacility;

/**
 * Default Module for binding everything needed for basic BHF service functionality.
 */
public class ServiceModule extends ServletModule
{
    public void configure()
    {
        super.configure();
        
        bind( CSRTokenFacility.class ).to( PBECSRTokenFacility.class ).in( Scopes.SINGLETON );
        bind( URLRouter.class ).to( DefaultURLRouter.class ).in( Scopes.SINGLETON );
        bind( ViewResolver.class ).to( I18nViewResolver.class ).in( Scopes.SINGLETON );
        bind( ComponentStateCache.class ).to( LRUComponentStateCache.class ).in( Scopes.SINGLETON );
//        bind( eMailFacility.class ).to( SMTPMailFacility.class ).in( Scopes.SINGLETON );
    }
}
